const orderArr = []
console.log("重新执行", orderArr);
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
    if (request.action === 'addData') {
        const { name, phone, address, orderNum, goodsSpecification, count, remark } = request.orderInfo
        if (orderArr.findIndex(item => item[4] === orderNum) === -1) {
            orderArr.push([orderArr.length + 1, name, phone, address, orderNum, '', goodsSpecification, count, remark])
        }
        chrome.runtime.sendMessage({ action: 'update_table_dom', orderArr });
    }
    if (request.action === 'done') {
        chrome.runtime.sendMessage({ action: 'collection_completed', orderArr });
    }
});